#!/usr/bin/env python2.4

"""Setuptools setup file"""

import sys, os

from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup

if sys.version_info < (2, 4):
    raise SystemExit("Python 2.4 or later is required ATM")

execfile(os.path.join("toscawidgets", "widgets","extJS","release.py"))

def get_description():
    # Adapted from PEAK-Rules' setup.py
    # Get our long description from the documentation
    f = file('docs/index.txt')
    lines = []
    for line in f:
        if not line.strip():
            break     # skip to first blank line
    for line in f:
        if line.startswith('Main differences'):
            break     # read to "Main differences..."
        lines.append(line)
    f.close()
    return ''.join(lines)

PACKAGES = [
    'toscawidgets.widgets.extJS'
    ]


setup(
    name=__PACKAGE_NAME__,
    version=__VERSION__,
    description="ToscaWidgets extension wrapping ExtJS 2.0",
    long_description = get_description(),
    install_requires=[
        'ToscaWidgets',
        'twForms'
        ],
#    extras_require = {
#        'cheetah': _extra_cheetah,
#        'kid': _extra_kid,
#        'genshi': _extra_genshi,
#        'mako': _extra_mako,
#        'testing': _extra_tests,
#        'build_docs':[
#            "pudge==dev,>=0.1.1dev_r130", 
#            "buildutils==dev,>=0.1.2dev-r107",
#            "kid==dev,>=0.9.4",
#            ],
#        'cjson': ["python-cjson"],
#        'resource_injector': ["lxml"],
#        },
    url = "http://twextjs.googlecode.com/",
    download_url = "http://twextjs.googlecode.com/files/twExtJS-0.0.1dev_r39-py2.4.egg",
    dependency_links=[
        'http://twextjs.googlecode.com/download/',
        ],
    author=__AUTHOR__,
    author_email=__EMAIL__,
    license=__LICENSE__,
    test_suite = 'tests',
    packages = PACKAGES,
    namespace_packages = ['toscawidgets','toscawidgets.widgets'],
    include_package_data=True,
    exclude_package_data={"thirdparty" : ["*"]},
    entry_points="""
    [python.templating.engines]
    toscawidgets = toscawidgets.engine_plugin:ToscaWidgetsTemplatePlugin

    [toscawidgets.host_frameworks]
    wsgi = toscawidgets.mods.wsgi:WSGIHostFramework
    pylons = toscawidgets.mods.pylonshf:PylonsHostFramework
    turbogears = toscawidgets.mods.tg:Turbogears

    [toscawidgets.widgets]
    widgets = toscawidgets.core
    resources = toscawidgets.resources

    [paste.paster_create_template]
    toscawidgets=toscawidgets.util:ToscaWidgetsTemplate

    [turbogears.extensions]
    toscawidgets=toscawidgets.mods.tg

    [paste.filter_app_factory]
    middleware = toscawidgets.middleware:make_middleware
    """,
    zip_safe=False,
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules'],
)
